# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: account.proto
# plugin: python-betterproto
# This file has been @generated

from dataclasses import dataclass
from datetime import datetime
from typing import (
    TYPE_CHECKING,
    AsyncIterable,
    AsyncIterator,
    Dict,
    Iterable,
    List,
    Optional,
    Union,
)

import betterproto
import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf
import grpclib
from betterproto.grpc.grpclib_server import ServiceBase


if TYPE_CHECKING:
    import grpclib.server
    from betterproto.grpc.grpclib_client import MetadataLike
    from grpclib.metadata import Deadline


class UserRole(betterproto.Enum):
    Guest = 0
    Player = 1
    Administrator = 2
    NannyModerator = 3
    RegularModerator = 4
    SeniorModerator = 5


class ColorSchema(betterproto.Enum):
    Modern = 0
    Pale = 1
    Classic = 2
    ClassicPale = 3
    Night = 4


class AccessPolicy(betterproto.Enum):
    NotSpecified = 0
    DemocraticBan = 1
    FullBan = 2
    ChatBan = 3
    RestrictContentEditing = 4


@dataclass(eq=False, repr=False)
class LoginRequest(betterproto.Message):
    login: str = betterproto.string_field(1)
    password: str = betterproto.string_field(2)
    remember_me: bool = betterproto.bool_field(3)


@dataclass(eq=False, repr=False)
class LoginResponse(betterproto.Message):
    user: "UserEnvelope" = betterproto.message_field(1)
    token: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class LogoutRequest(betterproto.Message):
    token: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class LogoutAllRequest(betterproto.Message):
    token: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class GetCurrentAccountRequest(betterproto.Message):
    token: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class GetCurrentAccountResponse(betterproto.Message):
    user: "UserDetailsEnvelope" = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class GetAccountsRequest(betterproto.Message):
    with_inactive: bool = betterproto.bool_field(1)
    paging: "PagingQuery" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class GetAccountsResponse(betterproto.Message):
    accounts: List["User"] = betterproto.message_field(1)
    paging: "PagingResult" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class RegisterAccountRequest(betterproto.Message):
    login: str = betterproto.string_field(1)
    email: str = betterproto.string_field(2)
    password: str = betterproto.string_field(3)


@dataclass(eq=False, repr=False)
class RegisterAccountResponse(betterproto.Message):
    id: str = betterproto.string_field(1)
    login: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class RegisterAccountClientStreamResponse(betterproto.Message):
    results: List[
        "RegisterAccountClientStreamResponseResult"
    ] = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class RegisterAccountClientStreamResponseResult(betterproto.Message):
    login: str = betterproto.string_field(1)
    id: str = betterproto.string_field(2, group="result")
    error: str = betterproto.string_field(3, group="result")


@dataclass(eq=False, repr=False)
class ActivateAccountRequest(betterproto.Message):
    activation_token: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class ActivateAccountResponse(betterproto.Message):
    user: "UserEnvelope" = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class ChangeAccountEmailRequest(betterproto.Message):
    login: str = betterproto.string_field(1)
    password: str = betterproto.string_field(2)
    email: str = betterproto.string_field(3)


@dataclass(eq=False, repr=False)
class ChangeAccountEmailResponse(betterproto.Message):
    user: "UserEnvelope" = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class ResetAccountPasswordRequest(betterproto.Message):
    login: str = betterproto.string_field(1)
    email: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class ResetAccountPasswordResponse(betterproto.Message):
    user: "UserEnvelope" = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class ChangeAccountPasswordRequest(betterproto.Message):
    login: str = betterproto.string_field(1)
    token: Optional[str] = betterproto.message_field(2, wraps=betterproto.TYPE_STRING)
    old_password: str = betterproto.string_field(3)
    new_password: str = betterproto.string_field(4)


@dataclass(eq=False, repr=False)
class ChangeAccountPasswordResponse(betterproto.Message):
    user: "UserEnvelope" = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class UpdateAccountRequest(betterproto.Message):
    token: str = betterproto.string_field(1)
    user_data: "UserUpdate" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class UpdateAccountResponse(betterproto.Message):
    user: "UserDetailsEnvelope" = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class TimestampValue(betterproto.Message):
    value: datetime = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class UserRating(betterproto.Message):
    enabled: bool = betterproto.bool_field(1)
    quality: int = betterproto.int32_field(2)
    quantity: int = betterproto.int32_field(3)


@dataclass(eq=False, repr=False)
class User(betterproto.Message):
    login: str = betterproto.string_field(1)
    roles: List["UserRole"] = betterproto.enum_field(2)
    medium_picture_url: Optional[str] = betterproto.message_field(
        3, wraps=betterproto.TYPE_STRING
    )
    small_picture_url: Optional[str] = betterproto.message_field(
        4, wraps=betterproto.TYPE_STRING
    )
    status: Optional[str] = betterproto.message_field(5, wraps=betterproto.TYPE_STRING)
    rating: "UserRating" = betterproto.message_field(6)
    online: "TimestampValue" = betterproto.message_field(7)
    name: Optional[str] = betterproto.message_field(8, wraps=betterproto.TYPE_STRING)
    location: Optional[str] = betterproto.message_field(
        9, wraps=betterproto.TYPE_STRING
    )
    registration: "TimestampValue" = betterproto.message_field(10)


@dataclass(eq=False, repr=False)
class UserDetails(betterproto.Message):
    login: str = betterproto.string_field(1)
    roles: List["UserRole"] = betterproto.enum_field(2)
    original_picture_url: Optional[str] = betterproto.message_field(
        3, wraps=betterproto.TYPE_STRING
    )
    medium_picture_url: Optional[str] = betterproto.message_field(
        4, wraps=betterproto.TYPE_STRING
    )
    small_picture_url: Optional[str] = betterproto.message_field(
        5, wraps=betterproto.TYPE_STRING
    )
    status: Optional[str] = betterproto.message_field(6, wraps=betterproto.TYPE_STRING)
    rating: "UserRating" = betterproto.message_field(7)
    online: "TimestampValue" = betterproto.message_field(8)
    name: Optional[str] = betterproto.message_field(9, wraps=betterproto.TYPE_STRING)
    location: Optional[str] = betterproto.message_field(
        10, wraps=betterproto.TYPE_STRING
    )
    registration: "TimestampValue" = betterproto.message_field(11)
    icq: Optional[str] = betterproto.message_field(12, wraps=betterproto.TYPE_STRING)
    skype: Optional[str] = betterproto.message_field(13, wraps=betterproto.TYPE_STRING)
    info: Optional[str] = betterproto.message_field(14, wraps=betterproto.TYPE_STRING)


@dataclass(eq=False, repr=False)
class UserUpdate(betterproto.Message):
    status: Optional[str] = betterproto.message_field(1, wraps=betterproto.TYPE_STRING)
    rating_disabled: Optional[bool] = betterproto.message_field(
        2, wraps=betterproto.TYPE_BOOL
    )
    name: Optional[str] = betterproto.message_field(3, wraps=betterproto.TYPE_STRING)
    location: Optional[str] = betterproto.message_field(
        4, wraps=betterproto.TYPE_STRING
    )
    icq: Optional[str] = betterproto.message_field(5, wraps=betterproto.TYPE_STRING)
    skype: Optional[str] = betterproto.message_field(6, wraps=betterproto.TYPE_STRING)
    info: Optional[str] = betterproto.message_field(7, wraps=betterproto.TYPE_STRING)
    user_settings: "UserSettings" = betterproto.message_field(8)


@dataclass(eq=False, repr=False)
class UserSettings(betterproto.Message):
    color_schema: "ColorSchema" = betterproto.enum_field(1)
    nanny_greetings_message: str = betterproto.string_field(2)
    paging_settings: "PagingSettings" = betterproto.message_field(3)


@dataclass(eq=False, repr=False)
class PagingQuery(betterproto.Message):
    size: Optional[int] = betterproto.message_field(1, wraps=betterproto.TYPE_INT32)
    number: Optional[int] = betterproto.message_field(2, wraps=betterproto.TYPE_INT32)
    skip: Optional[int] = betterproto.message_field(3, wraps=betterproto.TYPE_INT32)


@dataclass(eq=False, repr=False)
class PagingResult(betterproto.Message):
    total_pages_count: int = betterproto.int32_field(1)
    total_entities_count: int = betterproto.int32_field(2)
    current_page: int = betterproto.int32_field(3)
    page_size: int = betterproto.int32_field(4)
    entity_number: int = betterproto.int32_field(5)


@dataclass(eq=False, repr=False)
class PagingSettings(betterproto.Message):
    posts_per_page: int = betterproto.int32_field(1)
    comments_per_page: int = betterproto.int32_field(2)
    topics_per_page: int = betterproto.int32_field(3)
    messages_per_page: int = betterproto.int32_field(4)
    entities_per_page: int = betterproto.int32_field(5)


@dataclass(eq=False, repr=False)
class UserEnvelope(betterproto.Message):
    resource: "User" = betterproto.message_field(1)
    metadata: Optional[str] = betterproto.message_field(
        2, wraps=betterproto.TYPE_STRING
    )


@dataclass(eq=False, repr=False)
class UserDetailsEnvelope(betterproto.Message):
    resource: "UserDetails" = betterproto.message_field(1)
    metadata: Optional[str] = betterproto.message_field(
        2, wraps=betterproto.TYPE_STRING
    )


@dataclass(eq=False, repr=False)
class GetAccountsByLoginRequest(betterproto.Message):
    login: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class GetAccountsByLoginResponse(betterproto.Message):
    login: str = betterproto.string_field(1)
    user: "User" = betterproto.message_field(2, group="result")
    error: str = betterproto.string_field(3, group="result")


class AccountServiceStub(betterproto.ServiceStub):
    async def login(
        self,
        login_request: "LoginRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "LoginResponse":
        return await self._unary_unary(
            "/AccountService/Login",
            login_request,
            LoginResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def logout(
        self,
        logout_request: "LogoutRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "betterproto_lib_google_protobuf.Empty":
        return await self._unary_unary(
            "/AccountService/Logout",
            logout_request,
            betterproto_lib_google_protobuf.Empty,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def logout_all(
        self,
        logout_all_request: "LogoutAllRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "betterproto_lib_google_protobuf.Empty":
        return await self._unary_unary(
            "/AccountService/LogoutAll",
            logout_all_request,
            betterproto_lib_google_protobuf.Empty,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_current_account(
        self,
        get_current_account_request: "GetCurrentAccountRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "GetCurrentAccountResponse":
        return await self._unary_unary(
            "/AccountService/GetCurrentAccount",
            get_current_account_request,
            GetCurrentAccountResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_accounts(
        self,
        get_accounts_request: "GetAccountsRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "GetAccountsResponse":
        return await self._unary_unary(
            "/AccountService/GetAccounts",
            get_accounts_request,
            GetAccountsResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def register_account(
        self,
        register_account_request: "RegisterAccountRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "RegisterAccountResponse":
        return await self._unary_unary(
            "/AccountService/RegisterAccount",
            register_account_request,
            RegisterAccountResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def activate_account(
        self,
        activate_account_request: "ActivateAccountRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "ActivateAccountResponse":
        return await self._unary_unary(
            "/AccountService/ActivateAccount",
            activate_account_request,
            ActivateAccountResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def change_account_email(
        self,
        change_account_email_request: "ChangeAccountEmailRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "ChangeAccountEmailResponse":
        return await self._unary_unary(
            "/AccountService/ChangeAccountEmail",
            change_account_email_request,
            ChangeAccountEmailResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def reset_account_password(
        self,
        reset_account_password_request: "ResetAccountPasswordRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "ResetAccountPasswordResponse":
        return await self._unary_unary(
            "/AccountService/ResetAccountPassword",
            reset_account_password_request,
            ResetAccountPasswordResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def change_account_password(
        self,
        change_account_password_request: "ChangeAccountPasswordRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "ChangeAccountPasswordResponse":
        return await self._unary_unary(
            "/AccountService/ChangeAccountPassword",
            change_account_password_request,
            ChangeAccountPasswordResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def update_account(
        self,
        update_account_request: "UpdateAccountRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "UpdateAccountResponse":
        return await self._unary_unary(
            "/AccountService/UpdateAccount",
            update_account_request,
            UpdateAccountResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def register_account_client_stream(
        self,
        register_account_request_iterator: Union[
            AsyncIterable["RegisterAccountRequest"], Iterable["RegisterAccountRequest"]
        ],
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> "RegisterAccountClientStreamResponse":
        return await self._stream_unary(
            "/AccountService/RegisterAccountClientStream",
            register_account_request_iterator,
            RegisterAccountRequest,
            RegisterAccountClientStreamResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def get_accounts_server_stream(
        self,
        betterproto_lib_google_protobuf_empty: "betterproto_lib_google_protobuf.Empty",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> AsyncIterator["User"]:
        async for response in self._unary_stream(
            "/AccountService/GetAccountsServerStream",
            betterproto_lib_google_protobuf_empty,
            User,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        ):
            yield response

    async def get_accounts_by_login_duplex_stream(
        self,
        get_accounts_by_login_request_iterator: Union[
            AsyncIterable["GetAccountsByLoginRequest"],
            Iterable["GetAccountsByLoginRequest"],
        ],
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None,
    ) -> AsyncIterator["GetAccountsByLoginResponse"]:
        async for response in self._stream_stream(
            "/AccountService/GetAccountsByLoginDuplexStream",
            get_accounts_by_login_request_iterator,
            GetAccountsByLoginRequest,
            GetAccountsByLoginResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        ):
            yield response


class AccountServiceBase(ServiceBase):
    async def login(self, login_request: "LoginRequest") -> "LoginResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def logout(
        self, logout_request: "LogoutRequest"
    ) -> "betterproto_lib_google_protobuf.Empty":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def logout_all(
        self, logout_all_request: "LogoutAllRequest"
    ) -> "betterproto_lib_google_protobuf.Empty":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_current_account(
        self, get_current_account_request: "GetCurrentAccountRequest"
    ) -> "GetCurrentAccountResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_accounts(
        self, get_accounts_request: "GetAccountsRequest"
    ) -> "GetAccountsResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def register_account(
        self, register_account_request: "RegisterAccountRequest"
    ) -> "RegisterAccountResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def activate_account(
        self, activate_account_request: "ActivateAccountRequest"
    ) -> "ActivateAccountResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def change_account_email(
        self, change_account_email_request: "ChangeAccountEmailRequest"
    ) -> "ChangeAccountEmailResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def reset_account_password(
        self, reset_account_password_request: "ResetAccountPasswordRequest"
    ) -> "ResetAccountPasswordResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def change_account_password(
        self, change_account_password_request: "ChangeAccountPasswordRequest"
    ) -> "ChangeAccountPasswordResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def update_account(
        self, update_account_request: "UpdateAccountRequest"
    ) -> "UpdateAccountResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def register_account_client_stream(
        self, register_account_request_iterator: AsyncIterator["RegisterAccountRequest"]
    ) -> "RegisterAccountClientStreamResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def get_accounts_server_stream(
        self,
        betterproto_lib_google_protobuf_empty: "betterproto_lib_google_protobuf.Empty",
    ) -> AsyncIterator["User"]:
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)
        yield User()

    async def get_accounts_by_login_duplex_stream(
        self,
        get_accounts_by_login_request_iterator: AsyncIterator[
            "GetAccountsByLoginRequest"
        ],
    ) -> AsyncIterator["GetAccountsByLoginResponse"]:
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)
        yield GetAccountsByLoginResponse()

    async def __rpc_login(
        self, stream: "grpclib.server.Stream[LoginRequest, LoginResponse]"
    ) -> None:
        request = await stream.recv_message()
        response = await self.login(request)
        await stream.send_message(response)

    async def __rpc_logout(
        self,
        stream: "grpclib.server.Stream[LogoutRequest, betterproto_lib_google_protobuf.Empty]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.logout(request)
        await stream.send_message(response)

    async def __rpc_logout_all(
        self,
        stream: "grpclib.server.Stream[LogoutAllRequest, betterproto_lib_google_protobuf.Empty]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.logout_all(request)
        await stream.send_message(response)

    async def __rpc_get_current_account(
        self,
        stream: "grpclib.server.Stream[GetCurrentAccountRequest, GetCurrentAccountResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_current_account(request)
        await stream.send_message(response)

    async def __rpc_get_accounts(
        self, stream: "grpclib.server.Stream[GetAccountsRequest, GetAccountsResponse]"
    ) -> None:
        request = await stream.recv_message()
        response = await self.get_accounts(request)
        await stream.send_message(response)

    async def __rpc_register_account(
        self,
        stream: "grpclib.server.Stream[RegisterAccountRequest, RegisterAccountResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.register_account(request)
        await stream.send_message(response)

    async def __rpc_activate_account(
        self,
        stream: "grpclib.server.Stream[ActivateAccountRequest, ActivateAccountResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.activate_account(request)
        await stream.send_message(response)

    async def __rpc_change_account_email(
        self,
        stream: "grpclib.server.Stream[ChangeAccountEmailRequest, ChangeAccountEmailResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.change_account_email(request)
        await stream.send_message(response)

    async def __rpc_reset_account_password(
        self,
        stream: "grpclib.server.Stream[ResetAccountPasswordRequest, ResetAccountPasswordResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.reset_account_password(request)
        await stream.send_message(response)

    async def __rpc_change_account_password(
        self,
        stream: "grpclib.server.Stream[ChangeAccountPasswordRequest, ChangeAccountPasswordResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.change_account_password(request)
        await stream.send_message(response)

    async def __rpc_update_account(
        self,
        stream: "grpclib.server.Stream[UpdateAccountRequest, UpdateAccountResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.update_account(request)
        await stream.send_message(response)

    async def __rpc_register_account_client_stream(
        self,
        stream: "grpclib.server.Stream[RegisterAccountRequest, RegisterAccountClientStreamResponse]",
    ) -> None:
        request = stream.__aiter__()
        response = await self.register_account_client_stream(request)
        await stream.send_message(response)

    async def __rpc_get_accounts_server_stream(
        self,
        stream: "grpclib.server.Stream[betterproto_lib_google_protobuf.Empty, User]",
    ) -> None:
        request = await stream.recv_message()
        await self._call_rpc_handler_server_stream(
            self.get_accounts_server_stream,
            stream,
            request,
        )

    async def __rpc_get_accounts_by_login_duplex_stream(
        self,
        stream: "grpclib.server.Stream[GetAccountsByLoginRequest, GetAccountsByLoginResponse]",
    ) -> None:
        request = stream.__aiter__()
        await self._call_rpc_handler_server_stream(
            self.get_accounts_by_login_duplex_stream,
            stream,
            request,
        )

    def __mapping__(self) -> Dict[str, grpclib.const.Handler]:
        return {
            "/AccountService/Login": grpclib.const.Handler(
                self.__rpc_login,
                grpclib.const.Cardinality.UNARY_UNARY,
                LoginRequest,
                LoginResponse,
            ),
            "/AccountService/Logout": grpclib.const.Handler(
                self.__rpc_logout,
                grpclib.const.Cardinality.UNARY_UNARY,
                LogoutRequest,
                betterproto_lib_google_protobuf.Empty,
            ),
            "/AccountService/LogoutAll": grpclib.const.Handler(
                self.__rpc_logout_all,
                grpclib.const.Cardinality.UNARY_UNARY,
                LogoutAllRequest,
                betterproto_lib_google_protobuf.Empty,
            ),
            "/AccountService/GetCurrentAccount": grpclib.const.Handler(
                self.__rpc_get_current_account,
                grpclib.const.Cardinality.UNARY_UNARY,
                GetCurrentAccountRequest,
                GetCurrentAccountResponse,
            ),
            "/AccountService/GetAccounts": grpclib.const.Handler(
                self.__rpc_get_accounts,
                grpclib.const.Cardinality.UNARY_UNARY,
                GetAccountsRequest,
                GetAccountsResponse,
            ),
            "/AccountService/RegisterAccount": grpclib.const.Handler(
                self.__rpc_register_account,
                grpclib.const.Cardinality.UNARY_UNARY,
                RegisterAccountRequest,
                RegisterAccountResponse,
            ),
            "/AccountService/ActivateAccount": grpclib.const.Handler(
                self.__rpc_activate_account,
                grpclib.const.Cardinality.UNARY_UNARY,
                ActivateAccountRequest,
                ActivateAccountResponse,
            ),
            "/AccountService/ChangeAccountEmail": grpclib.const.Handler(
                self.__rpc_change_account_email,
                grpclib.const.Cardinality.UNARY_UNARY,
                ChangeAccountEmailRequest,
                ChangeAccountEmailResponse,
            ),
            "/AccountService/ResetAccountPassword": grpclib.const.Handler(
                self.__rpc_reset_account_password,
                grpclib.const.Cardinality.UNARY_UNARY,
                ResetAccountPasswordRequest,
                ResetAccountPasswordResponse,
            ),
            "/AccountService/ChangeAccountPassword": grpclib.const.Handler(
                self.__rpc_change_account_password,
                grpclib.const.Cardinality.UNARY_UNARY,
                ChangeAccountPasswordRequest,
                ChangeAccountPasswordResponse,
            ),
            "/AccountService/UpdateAccount": grpclib.const.Handler(
                self.__rpc_update_account,
                grpclib.const.Cardinality.UNARY_UNARY,
                UpdateAccountRequest,
                UpdateAccountResponse,
            ),
            "/AccountService/RegisterAccountClientStream": grpclib.const.Handler(
                self.__rpc_register_account_client_stream,
                grpclib.const.Cardinality.STREAM_UNARY,
                RegisterAccountRequest,
                RegisterAccountClientStreamResponse,
            ),
            "/AccountService/GetAccountsServerStream": grpclib.const.Handler(
                self.__rpc_get_accounts_server_stream,
                grpclib.const.Cardinality.UNARY_STREAM,
                betterproto_lib_google_protobuf.Empty,
                User,
            ),
            "/AccountService/GetAccountsByLoginDuplexStream": grpclib.const.Handler(
                self.__rpc_get_accounts_by_login_duplex_stream,
                grpclib.const.Cardinality.STREAM_STREAM,
                GetAccountsByLoginRequest,
                GetAccountsByLoginResponse,
            ),
        }
